package org.ant.MyCalculate;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;

public class MyCalculate extends Activity {
	/** Called when the activity is first created. */
	private static final int INSERT_ID = Menu.FIRST;

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.main);
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		super.onCreateOptionsMenu(menu);
		menu.add(0, INSERT_ID, 0, "Calculate");
		return true;
	}

	@Override
	public boolean onMenuItemSelected(int featureId, MenuItem item) {
		switch (item.getItemId()) {
		case INSERT_ID:
			appearCalulateMenu();
			return true;
		}
		return super.onMenuItemSelected(featureId, item);
	}
	
	public void appearCalulateMenu() {
		Intent calculateMenuIntent = new Intent(this, calculateMenu.class);
		startActivity(calculateMenuIntent);
	} 
}